package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.RemoveHistory;
import cn.wolfcode.crm.mapper.RemoveHistoryMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IRemoveHistoryService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class RemoveHistoryServiceImpl implements IRemoveHistoryService {
    @Autowired
    private RemoveHistoryMapper removeHistoryMapper;


    public void insert(RemoveHistory record) {
        removeHistoryMapper.insert(record);
    }

    public List<RemoveHistory> selectAll() {
        return removeHistoryMapper.selectAll();
    }

    public PageResult query(QueryObject qo) {
        int total = removeHistoryMapper.query4Count(qo);
        if(total > 0){
            return new PageResult(total,removeHistoryMapper.query4List(qo));
        }
        return new PageResult(total, Collections.EMPTY_LIST);
    }


}
